<!DOCTYPE html>
<html>
<head>
    <title>查看--中软高科-2015</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>
    <script type="text/javascript" src="../Js/ckeditor/ckeditor.js"></script>
 

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
    <script type="text/javascript">
    $(function () {       
		$('#backid').click(function(){
				window.location.href="index.html";
		 });
    });
    </script>
</head>
<body>
<form action="index.html" method="post" class="definewidth m20">
<table class="table table-bordered table-hover definewidth m10">
    <tr>
        <td width="10%" class="tableleft">姓名</td>
        <td ><span id="name">-</span></td>
    </tr>

    <tr>
        <td width="10%" class="tableleft">身份证号</td>
        <td><span id="idCar">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">挂号费</td>
        <td ><span id="price">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">社保号</td>
        <td><span id="card">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">联系电话</td>
        <td><span id="phone">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">是否自费</td>
        <td><span id="self">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">性别</td>
        <td><span id="sex">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">年龄</td>
        <td><span id="age">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">职业</td>
        <td><span id="work">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">初复诊</td>
        <td><span  id="lookDoctor">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">所挂科室</td>
        <td><span id="keshi">-</span></td>
    </tr>
    <tr>
        <td width="10%" class="tableleft">指定医生</td>
        <td><span  id="doctor_name">-</span></td>
    </tr>
	<tr>
        <td width="10%" class="tableleft">备注</td>
        <td><span   id="desc">-</span></td>
	</tr>
    <tr>
        <td colspan="2">
			<center>
				<button type="button" class="btn btn-success" name="backid" id="backid">返回列表</button>
			</center>
		</td>
    </tr>
</table>
</form>
</body>
</html>
<script>
    String.prototype.GetValue= function(para) {
        let reg = new RegExp("(^|&)"+ para +"=([^&]*)(&|$)");
        let r = this.substr(this.indexOf("\?")+1).match(reg);
        if (r!=null) return unescape(r[2]); return null;
    }
    $(function () {
        //根据地址获取Id,如果null则执行增加，否则执行更新
        let url = document.location.toString();//获取URL
        let hosR_id=url.GetValue("hosR_id");
        queryById(hosR_id);
        
        function queryById(hosR_id) {
            $.ajax({
                type: "GET",
                url: "/hosRegister/" + hosR_id, //RESTful风格的API定义
                data: "",
                success: function (vo) {
                    let obj = vo.obj;
                    let hosR_name = obj.hosR_name;
                    let idCar = obj.hosR_idCar;
                    let card = obj.hosR_medical;
                    let price = obj.hosR_regPrice;
                    let self = obj.hosR_selfPrice==0?"否":"是";
                    let sex = obj.hosR_sex==0?"男":"女";
                    let age = obj.hosR_age;
                    let work = obj.hosR_work;
                    let keshi = obj.departments.d_name;
                    let doctor_name = obj.doctor.doctor_name;
                    let desc = obj.hosR_remark;
                    let phone = obj.hosR_phone;
                    let lookDoctor = obj.hosR_lookDoctor==0?"初诊":"复诊";
                    $("#phone").html(phone);
                    $("#lookDoctor").html(lookDoctor)
                    $("#name").html(hosR_name);
                    $("#card").html(card);
                    $("#idCar").html(idCar);
                    $("#price").html(price);
                    $("#self").html(self);
                    $("#sex").html(sex);
                    $("#age").html(age);
                    $("#work").html(work);
                    $("#keshi").html(keshi);
                    $("#doctor_name").html(doctor_name);
                    $("#desc").html(desc);
                }
            })
        }
    })
</script>